﻿using System;
using System.IO;



namespace DXTools.UI.Modules.JavaScriptConverter.Helpers
{
    public static class FileHelper
    {
        public static string ReadFile(FileStream Stream)
        {
            string text = String.Empty;

            using (StreamReader file = new StreamReader(Stream))
            {
                text = file.ReadToEnd();
                file.Close();
            }
            return text;
        }
 
        public static void SaveFile(String FileContents, Stream Stream)
        {
            
            using (StreamWriter file = new StreamWriter(Stream))
            {
                file.Write(FileContents);
                file.Close();
           
            }
        }
    }
}
